activateAction(id) {
switch (id) {
- case POWER_OFF_ACTION_ID:
- this.activatePowerOff();
- break;
- case LOCK_SCREEN_ACTION_ID:
- this.activateLockScreen();
- break;
- case LOGOUT_ACTION_ID:
- this.activateLogout();
- break;
- case SUSPEND_ACTION_ID:
- this.activateSuspend();
- break;
- case SWITCH_USER_ACTION_ID:
- this.activateSwitchUser();
- break;
- case LOCK_ORIENTATION_ACTION_ID:
- this.activateLockOrientation();
- break;
+ case POWER_OFF_ACTION_ID:
+ this.activatePowerOff();
+ break;
+ case LOCK_SCREEN_ACTION_ID:
+ this.activateLockScreen();
+ break;
+ case LOGOUT_ACTION_ID:
+ this.activateLogout();
+ break;
+ case SUSPEND_ACTION_ID:
+ this.activateSuspend();
+ break;
+ case SWITCH_USER_ACTION_ID:
+ this.activateSwitchUser();
+ break;
+ case LOCK_ORIENTATION_ACTION_ID:
+ this.activateLockOrientation();
+ break;
}
}
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
switch (mode) {
- case AppIconMode.THUMBNAIL_ONLY:
- size = WINDOW_PREVIEW_SIZE;
- this._icon.add_actor(_createWindowClone(mutterWindow, size * scaleFactor));
- break;
-
- case AppIconMode.BOTH:
- size = WINDOW_PREVIEW_SIZE;
- this._icon.add_actor(_createWindowClone(mutterWindow, size * scaleFactor));
-
- if (this.app)
- this._icon.add_actor(this._createAppIcon(this.app,
- APP_ICON_SIZE_SMALL));
- break;
-
- case AppIconMode.APP_ICON_ONLY:
- size = APP_ICON_SIZE;
- this._icon.add_actor(this._createAppIcon(this.app, size));
+ case AppIconMode.THUMBNAIL_ONLY:
+ size = WINDOW_PREVIEW_SIZE;
+ this._icon.add_actor(_createWindowClone(mutterWindow, size * scaleFactor));
+ break;
+
+ case AppIconMode.BOTH:
+ size = WINDOW_PREVIEW_SIZE;
+ this._icon.add_actor(_createWindowClone(mutterWindow, size * scaleFactor));
+
+ if (this.app)
+ this._icon.add_actor(this._createAppIcon(this.app,
+ APP_ICON_SIZE_SMALL));
+ break;
+
+ case AppIconMode.APP_ICON_ONLY:
+ size = APP_ICON_SIZE;
+ this._icon.add_actor(this._createAppIcon(this.app, size));
}
this._icon.set_size(size * scaleFactor, size * scaleFactor);
let direction;
let isLtr = Clutter.get_default_text_direction() == Clutter.TextDirection.LTR;
switch (event.get_key_symbol()) {
- case Clutter.Down:
- direction = St.DirectionType.TAB_FORWARD;
- break;
- case Clutter.Right:
- direction = isLtr ? St.DirectionType.TAB_FORWARD :
+ case Clutter.Down:
+ direction = St.DirectionType.TAB_FORWARD;
+ break;
+ case Clutter.Right:
+ direction = isLtr ? St.DirectionType.TAB_FORWARD :
St.DirectionType.TAB_BACKWARD;
- break;
- case Clutter.Up:
- direction = St.DirectionType.TAB_BACKWARD;
- break;
- case Clutter.Left:
- direction = isLtr ? St.DirectionType.TAB_BACKWARD :
+ break;
+ case Clutter.Up:
+ direction = St.DirectionType.TAB_BACKWARD;
+ break;
+ case Clutter.Left:
+ direction = isLtr ? St.DirectionType.TAB_BACKWARD :
St.DirectionType.TAB_FORWARD;
- break;
- default:
- return Clutter.EVENT_PROPAGATE;
+ break;
+ default:
+ return Clutter.EVENT_PROPAGATE;
}
return actor.navigate_focus(null, direction, false);
}
_getDeviceLabel(device) {
switch (device) {
- case AudioDevice.HEADPHONES:
- return _("Headphones");
- case AudioDevice.HEADSET:
- return _("Headset");
- case AudioDevice.MICROPHONE:
- return _("Microphone");
- default:
- return null;
+ case AudioDevice.HEADPHONES:
+ return _("Headphones");
+ case AudioDevice.HEADSET:
+ return _("Headset");
+ case AudioDevice.MICROPHONE:
+ return _("Microphone");
+ default:
+ return null;
}
}
_getDeviceIcon(device) {
switch (device) {
- case AudioDevice.HEADPHONES:
- return 'audio-headphones-symbolic';
- case AudioDevice.HEADSET:
- return 'audio-headset-symbolic';
- case AudioDevice.MICROPHONE:
- return 'audio-input-microphone-symbolic';
- default:
- return null;
+ case AudioDevice.HEADPHONES:
+ return 'audio-headphones-symbolic';
+ case AudioDevice.HEADSET:
+ return 'audio-headset-symbolic';
+ case AudioDevice.MICROPHONE:
+ return 'audio-input-microphone-symbolic';
+ default:
+ return null;
}
}
if (animate & PopupAnimation.SLIDE) {
switch (this._arrowSide) {
- case St.Side.TOP:
- this.translation_y = -rise;
- break;
- case St.Side.BOTTOM:
- this.translation_y = rise;
- break;
- case St.Side.LEFT:
- this.translation_x = -rise;
- break;
- case St.Side.RIGHT:
- this.translation_x = rise;
- break;
+ case St.Side.TOP:
+ this.translation_y = -rise;
+ break;
+ case St.Side.BOTTOM:
+ this.translation_y = rise;
+ break;
+ case St.Side.LEFT:
+ this.translation_x = -rise;
+ break;
+ case St.Side.RIGHT:
+ this.translation_x = rise;
+ break;
}
}
if (animate & PopupAnimation.SLIDE) {
switch (this._arrowSide) {
- case St.Side.TOP:
- translationY = rise;
- break;
- case St.Side.BOTTOM:
- translationY = -rise;
- break;
- case St.Side.LEFT:
- translationX = rise;
- break;
- case St.Side.RIGHT:
- translationX = -rise;
- break;
+ case St.Side.TOP:
+ translationY = rise;
+ break;
+ case St.Side.BOTTOM:
+ translationY = -rise;
+ break;
+ case St.Side.LEFT:
+ translationX = rise;
+ break;
+ case St.Side.RIGHT:
+ translationX = -rise;
+ break;
}
}
childBox.x2 = availWidth - borderWidth;
childBox.y2 = availHeight - borderWidth;
switch (this._arrowSide) {
- case St.Side.TOP:
- childBox.y1 += rise;
- break;
- case St.Side.BOTTOM:
- childBox.y2 -= rise;
- break;
- case St.Side.LEFT:
- childBox.x1 += rise;
- break;
- case St.Side.RIGHT:
- childBox.x2 -= rise;
- break;
+ case St.Side.TOP:
+ childBox.y1 += rise;
+ break;
+ case St.Side.BOTTOM:
+ childBox.y2 -= rise;
+ break;
+ case St.Side.LEFT:
+ childBox.x1 += rise;
+ break;
+ case St.Side.RIGHT:
+ childBox.x2 -= rise;
+ break;
}
this.bin.allocate(childBox, flags);
let presenceType = this._contact.get_presence_type();
switch (presenceType) {
- case Tp.ConnectionPresenceType.AVAILABLE:
- iconName = 'user-available';
- break;
- case Tp.ConnectionPresenceType.BUSY:
- iconName = 'user-busy';
- break;
- case Tp.ConnectionPresenceType.OFFLINE:
- iconName = 'user-offline';
- break;
- case Tp.ConnectionPresenceType.HIDDEN:
- iconName = 'user-invisible';
- break;
- case Tp.ConnectionPresenceType.AWAY:
- iconName = 'user-away';
- break;
- case Tp.ConnectionPresenceType.EXTENDED_AWAY:
- iconName = 'user-idle';
- break;
- default:
- iconName = 'user-offline';
- }
- return new Gio.ThemedIcon({ name: iconName });
+ case Tp.ConnectionPresenceType.AVAILABLE:
+ iconName = 'user-available';
+ break;
+ case Tp.ConnectionPresenceType.BUSY:
+ iconName = 'user-busy';
+ break;
+ case Tp.ConnectionPresenceType.OFFLINE:
+ iconName = 'user-offline';
+ break;
+ case Tp.ConnectionPresenceType.HIDDEN:
+ iconName = 'user-invisible';
+ break;
+ case Tp.ConnectionPresenceType.AWAY:
+ iconName = 'user-away';
+ break;
+ case Tp.ConnectionPresenceType.EXTENDED_AWAY:
+ iconName = 'user-idle';
+ break;
+ default:
+ iconName = 'user-offline';
+ }
+ return new Gio.ThemedIcon({ name: iconName });
}
_updateAvatarIcon() {
let dropFunc = dragMonitors[i].dragDrop;
if (dropFunc)
switch (dropFunc(dropEvent)) {
- case DragDropResult.FAILURE:
- case DragDropResult.SUCCESS:
- return true;
- case DragDropResult.CONTINUE:
- continue;
+ case DragDropResult.FAILURE:
+ case DragDropResult.SUCCESS:
+ return true;
+ case DragDropResult.CONTINUE:
+ continue;
}
}
// Trigger the offline update as requested
if (this._checkBox.actor.checked) {
switch (signal) {
- case "ConfirmedReboot":
- this._triggerOfflineUpdateReboot(callback);
- break;
- case "ConfirmedShutdown":
- // To actually trigger the offline update, we need to
- // reboot to do the upgrade. When the upgrade is complete,
- // the computer will shut down automatically.
- signal = "ConfirmedReboot";
- this._triggerOfflineUpdateShutdown(callback);
- break;
- default:
- callback();
- break;
+ case "ConfirmedReboot":
+ this._triggerOfflineUpdateReboot(callback);
+ break;
+ case "ConfirmedShutdown":
+ // To actually trigger the offline update, we need to
+ // reboot to do the upgrade. When the upgrade is complete,
+ // the computer will shut down automatically.
+ signal = "ConfirmedReboot";
+ this._triggerOfflineUpdateShutdown(callback);
+ break;
+ default:
+ callback();
+ break;
}
} else {
this._triggerOfflineUpdateCancel(callback);
let leftEmptySpace;
switch (this._xAlign) {
- case St.Align.START:
- leftEmptySpace = 0;
- break;
- case St.Align.MIDDLE:
- leftEmptySpace = Math.floor((availWidth - usedWidth) / 2);
- break;
- case St.Align.END:
- leftEmptySpace = availWidth - usedWidth;
+ case St.Align.START:
+ leftEmptySpace = 0;
+ break;
+ case St.Align.MIDDLE:
+ leftEmptySpace = Math.floor((availWidth - usedWidth) / 2);
+ break;
+ case St.Align.END:
+ leftEmptySpace = availWidth - usedWidth;
}
let animating = this._clonesAnimating.length > 0;
let leftEmptySpace;
switch (this._xAlign) {
- case St.Align.START:
- leftEmptySpace = 0;
- break;
- case St.Align.MIDDLE:
- leftEmptySpace = Math.floor((availWidth - usedWidth) / 2);
- break;
- case St.Align.END:
- leftEmptySpace = availWidth - usedWidth;
+ case St.Align.START:
+ leftEmptySpace = 0;
+ break;
+ case St.Align.MIDDLE:
+ leftEmptySpace = Math.floor((availWidth - usedWidth) / 2);
+ break;
+ case St.Align.END:
+ leftEmptySpace = availWidth - usedWidth;
}
let x = box.x1 + leftEmptySpace + this.leftPadding;
_stateToString(extensionState) {
switch (extensionState) {
- case ExtensionSystem.ExtensionState.ENABLED:
- return _("Enabled");
- case ExtensionSystem.ExtensionState.DISABLED:
- case ExtensionSystem.ExtensionState.INITIALIZED:
- return _("Disabled");
- case ExtensionSystem.ExtensionState.ERROR:
- return _("Error");
- case ExtensionSystem.ExtensionState.OUT_OF_DATE:
- return _("Out of date");
- case ExtensionSystem.ExtensionState.DOWNLOADING:
- return _("Downloading");
+ case ExtensionSystem.ExtensionState.ENABLED:
+ return _("Enabled");
+ case ExtensionSystem.ExtensionState.DISABLED:
+ case ExtensionSystem.ExtensionState.INITIALIZED:
+ return _("Disabled");
+ case ExtensionSystem.ExtensionState.ERROR:
+ return _("Error");
+ case ExtensionSystem.ExtensionState.OUT_OF_DATE:
+ return _("Out of date");
+ case ExtensionSystem.ExtensionState.DOWNLOADING:
+ return _("Downloading");
}
return 'Unknown'; // Not translated, shouldn't appear
}
*/
setScreenPosition(inPosition) {
switch (inPosition) {
- case GDesktopEnums.MagnifierScreenPosition.FULL_SCREEN:
- this.setFullScreenMode();
- break;
- case GDesktopEnums.MagnifierScreenPosition.TOP_HALF:
- this.setTopHalf();
- break;
- case GDesktopEnums.MagnifierScreenPosition.BOTTOM_HALF:
- this.setBottomHalf();
- break;
- case GDesktopEnums.MagnifierScreenPosition.LEFT_HALF:
- this.setLeftHalf();
- break;
- case GDesktopEnums.MagnifierScreenPosition.RIGHT_HALF:
- this.setRightHalf();
- break;
+ case GDesktopEnums.MagnifierScreenPosition.FULL_SCREEN:
+ this.setFullScreenMode();
+ break;
+ case GDesktopEnums.MagnifierScreenPosition.TOP_HALF:
+ this.setTopHalf();
+ break;
+ case GDesktopEnums.MagnifierScreenPosition.BOTTOM_HALF:
+ this.setBottomHalf();
+ break;
+ case GDesktopEnums.MagnifierScreenPosition.LEFT_HALF:
+ this.setLeftHalf();
+ break;
+ case GDesktopEnums.MagnifierScreenPosition.RIGHT_HALF:
+ this.setRightHalf();
+ break;
}
}
_fallbackIconForNotificationData(hints) {
let stockIcon;
switch (hints.urgency) {
- case Urgency.LOW:
- case Urgency.NORMAL:
- stockIcon = 'dialog-information';
- break;
- case Urgency.CRITICAL:
- stockIcon = 'dialog-error';
- break;
+ case Urgency.LOW:
+ case Urgency.NORMAL:
+ stockIcon = 'dialog-information';
+ break;
+ case Urgency.CRITICAL:
+ stockIcon = 'dialog-error';
+ break;
}
return new Gio.ThemedIcon({ name: stockIcon });
}
delete this._notifications[ndata.id];
let notificationClosedReason;
switch (reason) {
- case MessageTray.NotificationDestroyedReason.EXPIRED:
- notificationClosedReason = NotificationClosedReason.EXPIRED;
- break;
- case MessageTray.NotificationDestroyedReason.DISMISSED:
- notificationClosedReason = NotificationClosedReason.DISMISSED;
- break;
- case MessageTray.NotificationDestroyedReason.SOURCE_CLOSED:
- notificationClosedReason = NotificationClosedReason.APP_CLOSED;
- break;
+ case MessageTray.NotificationDestroyedReason.EXPIRED:
+ notificationClosedReason = NotificationClosedReason.EXPIRED;
+ break;
+ case MessageTray.NotificationDestroyedReason.DISMISSED:
+ notificationClosedReason = NotificationClosedReason.DISMISSED;
+ break;
+ case MessageTray.NotificationDestroyedReason.SOURCE_CLOSED:
+ notificationClosedReason = NotificationClosedReason.APP_CLOSED;
+ break;
}
this._emitNotificationClosed(ndata.id, notificationClosedReason);
});
}
switch (hints.urgency) {
- case Urgency.LOW:
- notification.setUrgency(MessageTray.Urgency.LOW);
- break;
- case Urgency.NORMAL:
- notification.setUrgency(MessageTray.Urgency.NORMAL);
- break;
- case Urgency.CRITICAL:
- notification.setUrgency(MessageTray.Urgency.CRITICAL);
- break;
+ case Urgency.LOW:
+ notification.setUrgency(MessageTray.Urgency.LOW);
+ break;
+ case Urgency.NORMAL:
+ notification.setUrgency(MessageTray.Urgency.NORMAL);
+ break;
+ case Urgency.CRITICAL:
+ notification.setUrgency(MessageTray.Urgency.CRITICAL);
+ break;
}
notification.setResident(!!hints.resident);
// 'transient' is a reserved keyword in JS, so we have to retrieve the value
function arrowIcon(side) {
let iconName;
switch (side) {
- case St.Side.TOP:
- iconName = 'pan-up-symbolic';
- break;
- case St.Side.RIGHT:
- iconName = 'pan-end-symbolic';
- break;
- case St.Side.BOTTOM:
- iconName = 'pan-down-symbolic';
- break;
- case St.Side.LEFT:
- iconName = 'pan-start-symbolic';
- break;
+ case St.Side.TOP:
+ iconName = 'pan-up-symbolic';
+ break;
+ case St.Side.RIGHT:
+ iconName = 'pan-end-symbolic';
+ break;
+ case St.Side.BOTTOM:
+ iconName = 'pan-down-symbolic';
+ break;
+ case St.Side.LEFT:
+ iconName = 'pan-start-symbolic';
+ break;
}
let arrow = new St.Icon({ style_class: 'popup-menu-arrow',
let navKey;
switch (this._boxPointer.arrowSide) {
- case St.Side.TOP:
- navKey = Clutter.KEY_Down;
- break;
- case St.Side.BOTTOM:
- navKey = Clutter.KEY_Up;
- break;
- case St.Side.LEFT:
- navKey = Clutter.KEY_Right;
- break;
- case St.Side.RIGHT:
- navKey = Clutter.KEY_Left;
- break;
+ case St.Side.TOP:
+ navKey = Clutter.KEY_Down;
+ break;
+ case St.Side.BOTTOM:
+ navKey = Clutter.KEY_Up;
+ break;
+ case St.Side.LEFT:
+ navKey = Clutter.KEY_Right;
+ break;
+ case St.Side.RIGHT:
+ navKey = Clutter.KEY_Left;
+ break;
}
let state = event.get_state();
_getSummaryIcon() {
switch (this._category) {
- case NMConnectionCategory.WIRED:
- return 'network-wired-symbolic';
- case NMConnectionCategory.WIRELESS:
- case NMConnectionCategory.WWAN:
- return 'network-wireless-symbolic';
+ case NMConnectionCategory.WIRED:
+ return 'network-wired-symbolic';
+ case NMConnectionCategory.WIRELESS:
+ case NMConnectionCategory.WWAN:
+ return 'network-wireless-symbolic';
}
return '';
}
_getSummaryLabel(nDevices) {
switch (this._category) {
- case NMConnectionCategory.WIRED:
- return ngettext("%s Wired Connection",
- "%s Wired Connections",
- nDevices).format(nDevices);
- case NMConnectionCategory.WIRELESS:
- return ngettext("%s Wi-Fi Connection",
- "%s Wi-Fi Connections",
- nDevices).format(nDevices);
- case NMConnectionCategory.WWAN:
- return ngettext("%s Modem Connection",
- "%s Modem Connections",
- nDevices).format(nDevices);
+ case NMConnectionCategory.WIRED:
+ return ngettext("%s Wired Connection",
+ "%s Wired Connections",
+ nDevices).format(nDevices);
+ case NMConnectionCategory.WIRELESS:
+ return ngettext("%s Wi-Fi Connection",
+ "%s Wi-Fi Connections",
+ nDevices).format(nDevices);
+ case NMConnectionCategory.WWAN:
+ return ngettext("%s Modem Connection",
+ "%s Modem Connections",
+ nDevices).format(nDevices);
}
return '';
}
_startSwitcher(display, window, binding) {
let constructor = null;
switch (binding.get_name()) {
- case 'switch-applications':
- case 'switch-applications-backward':
- case 'switch-group':
- case 'switch-group-backward':
- constructor = AltTab.AppSwitcherPopup;
- break;
- case 'switch-windows':
- case 'switch-windows-backward':
- constructor = AltTab.WindowSwitcherPopup;
- break;
- case 'cycle-windows':
- case 'cycle-windows-backward':
- constructor = AltTab.WindowCyclerPopup;
- break;
- case 'cycle-group':
- case 'cycle-group-backward':
- constructor = AltTab.GroupCyclerPopup;
- break;
- case 'switch-monitor':
- constructor = SwitchMonitor.SwitchMonitorPopup;
- break;
+ case 'switch-applications':
+ case 'switch-applications-backward':
+ case 'switch-group':
+ case 'switch-group-backward':
+ constructor = AltTab.AppSwitcherPopup;
+ break;
+ case 'switch-windows':
+ case 'switch-windows-backward':
+ constructor = AltTab.WindowSwitcherPopup;
+ break;
+ case 'cycle-windows':
+ case 'cycle-windows-backward':
+ constructor = AltTab.WindowCyclerPopup;
+ break;
+ case 'cycle-group':
+ case 'cycle-group-backward':
+ constructor = AltTab.GroupCyclerPopup;
+ break;
+ case 'switch-monitor':
+ constructor = SwitchMonitor.SwitchMonitorPopup;
+ break;
}
if (!constructor)